package teach.day04;

import java.util.Stack;

//进制转换
public class P06StackApp {
    public static void main(String[] args) {
        Stack<Integer> s = new Stack<Integer>();
        int n = 6;
        while (n > 0) {
//            System.out.println(n%2);
            s.push(n%2);
            n /= 2;
        }
        while (!s.isEmpty()) {
            System.out.print(s.peek() + " ");
            s.pop();
        }
    }
}
